From 8f846225c20c8e8379038f2288afd373bcdaec5c Mon Sep 17 00:00:00 2001 From: "root@dyn9047022116.beaverton.ibm.com" Date: Sat, 11 Mar 2006 11:46:38 +0100 Subject: [PATCH] HG Patch Add feature to layer xm-test tests, grouping of tests by casename and execution of tests by user specified lists. Signed-off-by: Woody Marvel --- tools/xm-test/README | 23 ++++++++----- tools/xm-test/grouptest/create | 1 + tools/xm-test/grouptest/default | 30 +++++++++++++++++ tools/xm-test/grouptest/quick | 4 +++ tools/xm-test/runtest.sh | 59 ++++++++++++++++----------------- 5 files changed, 78 insertions(+), 39 deletions(-) create mode 100644 tools/xm-test/grouptest/create create mode 100644 tools/xm-test/grouptest/default create mode 100644 tools/xm-test/grouptest/quick diff --git a/tools/xm-test/README b/tools/xm-test/README index ca5b70e81a..978e0dc693 100644 --- a/tools/xm-test/README +++ b/tools/xm-test/README @@ -120,8 +120,9 @@ To run the full test suite, do the following as root: # ./runtest.sh This will run all tests, as well as generate and submit a report at -the end. All output files will begin with "." If you wish to -prevent submission of a report, add "-d" to the command line like this: +the end. All output files will begin with "." +If you wish to prevent submission of a report, add "-d" to the +command line like this: # ./runtest.sh -d @@ -131,15 +132,19 @@ submit the report at a later time. To do so, run runtest.sh with the # ./runtest.sh -s -For people needing a quick test run instead the full suite, a quick -mode has been added that will attempt to run a representative subset -of tests. This is not a substitute for the whole suite, but will -verify that some of the major functions of xen and xm are working: +Group test sets are supported in xm-test. This is form of layering of +tests groups/cases/tests. In the framework directory "grouptest", +files exist for group processing. The user can add groups, casenames +and test lists as required. Default group run is "grouptest/default". + + # ./runtest.sh -g + +* NOTE: There is a quick set of tests in group mode, that was added to +run certain casenames and tests. It is not a substitute for the full +xm-test test suite. + # ./runtest.sh -g quick - # ./runtest.sh -q -Because of the current structure of the reporting software, submission -of quick test run results is not supported. It may be desirable to run a specific test group. This can be accomplished by doing the following: diff --git a/tools/xm-test/grouptest/create b/tools/xm-test/grouptest/create new file mode 100644 index 0000000000..359af40016 --- /dev/null +++ b/tools/xm-test/grouptest/create @@ -0,0 +1 @@ +create diff --git a/tools/xm-test/grouptest/default b/tools/xm-test/grouptest/default new file mode 100644 index 0000000000..66ba66c835 --- /dev/null +++ b/tools/xm-test/grouptest/default @@ -0,0 +1,30 @@ +block-create +block-destroy +block-list +console +create +destroy +dmesg +domid +domname +enforce_dom0_cpus +help +info +list +memmax +memset +migrate +network +network-attach +pause +reboot +restore +save +sedf +shutdown +sysrq +unpause +vcpu-disable +vcpu-pin +vtpm + diff --git a/tools/xm-test/grouptest/quick b/tools/xm-test/grouptest/quick new file mode 100644 index 0000000000..2b538af43a --- /dev/null +++ b/tools/xm-test/grouptest/quick @@ -0,0 +1,4 @@ +create 01_create_basic_pos.test 07_create_mem64_pos.test 10_create_fastdestroy.test 14_create_blockroot_pos.test +unpause 01_unpause_basic_pos.test +memset 01_memset_basic_pos.test 03_memset_random_pos.test +help 06_help_allcmds.test diff --git a/tools/xm-test/runtest.sh b/tools/xm-test/runtest.sh index 25aa2d842d..ec9363ea8d 100755 --- a/tools/xm-test/runtest.sh +++ b/tools/xm-test/runtest.sh @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/sh ## ## Test driver script @@ -11,7 +11,7 @@ usage() { echo " Where opts are:" echo " -d : do not submit a report for this run" echo " -b : do not ask any questions (batch mode)" - echo " -q : run a quick test set" + echo " -g : run a group test set" echo " -e : set email address for report" echo " -s : just submit report " echo " -h | --help : show this help" @@ -92,12 +92,13 @@ runnable_tests() { echo "Running sanity checks..." make -C tests/_sanity check 2>&1 | grep REASON if [ $? -eq 0 ]; then - echo "Sanity checks failed" - exit 1 + echo "Sanity checks failed" + exit 1 fi } + # Get contact info if needed get_contact_info() { @@ -128,26 +129,21 @@ get_contact_info() { # Run the tests run_tests() { - output=$1 - echo Running real tests... - TEST_VERBOSE=1 make -k check > $output 2>&1 -} - -run_tests_quick() { + groupentered=$1 + output=$2 - output=$1 + exec < grouptest/$groupentered + while read casename testlist; do + echo Running $casename tests... + echo "*** case $casename from group $groupentered" >> $output + if [ -z "$testlist" ]; then + echo "*** Running tests for case $casename" >> $output + (cd tests/$casename && TEST_VERBOSE=1 make -k check) >> $output 2>&1 + else + echo "*** Running tests $testlist from case $casename" >> $output + (cd tests/$casename && TEST_VERBOSE=1 make -k check TESTS="$testlist") >> $output 2>&1 + fi - create_tests="01_create_basic_pos.test 07_create_mem64_pos.test 10_create_fastdestroy.test 14_create_blockroot_pos.test" - unpause_tests="01_unpause_basic_pos.test" - memset_tests="01_memset_basic_pos.test 03_memset_random_pos.test" - help_tests="06_help_allcmds.test" - testgroups="create unpause memset help" - - echo "*** Quick test" > $output - for group in $testgroups; do - eval $(echo list=\$${group}_tests) - echo "*** Running tests [$list] from $group" - (cd tests/$group && TEST_VERBOSE=1 make -k check TESTS="$list") >> $output 2>&1 done } @@ -195,6 +191,7 @@ MAXFAIL=10 report=yes batch=no run=yes +GROUPENTERED=default # Resolve options while [ $# -gt 0 ] @@ -213,8 +210,13 @@ while [ $# -gt 0 ] echo $1 > contact_info echo "(Email set to $1)" ;; - -q) - run=quick + -g) + shift + GROUPENTERED=$1 + if [ ! -f grouptest/$GROUPENTERED ]; then + echo "No file for group $GROUPENTERED" + exit 1 + fi ;; -s) run=no @@ -265,18 +267,15 @@ fi if [ "$run" != "no" ]; then runnable_tests make_environment_report $OSREPORTTEMP $PROGREPORTTEMP - if [ "$run" = "yes" ]; then - run_tests $OUTPUT - else - run_tests_quick $OUTPUT - fi + run_tests $GROUPENTERED $OUTPUT make_text_reports $PASSFAIL $FAILURES $OUTPUT $TXTREPORT make_result_report $OUTPUT $RESULTREPORTTEMP cat $OSREPORTTEMP $PROGREPORTTEMP $RESULTREPORTTEMP > $XMLREPORT rm $OSREPORTTEMP $PROGREPORTTEMP $RESULTREPORTTEMP + fi -if [ "$report" = "yes" ] && [ "$run" = "yes" ]; then +if [ "$report" = "yes" ]; then if [ ! -f "$XMLREPORT" ]; then echo "No such file: $XMLREPORT" exit 1 -- 2.30.2